Fedora 15
Sponsored Link

Physical Volume
2011/05/09
[1] Create a Physical Volume
[root@dlp ~]#
pvcreate /dev/sdb1

  Physical volume "/dev/sdb1" successfully created

# input like below if you'd like to specify the amount

[root@dlp ~]#
pvcreate --setphysicalvolumesize 50G /dev/sdb1

  Physical volume "/dev/sdb1" successfully created
[2] Display a status of Physical volumes
[root@dlp ~]#
pvdisplay /dev/sdb1

  --- NEW Physical volume ---
  PV Name
/dev/sdb1

  VG Name
  PV Size
50.00 GiB

  Allocatable
NO

  PE Size (KByte)
0

  Total PE
0

  Free PE
0

  Allocated PE
0

  PV UUID
hPjJK2-tEgt-RztW-CLLH-NYR3-4t4a-hNt6qT

[3] Change size of a Physical volume
# change size to 100G

[root@dlp ~]#
pvresize --setphysicalvolumesize 100G /dev/sdb1

  Physical volume "/dev/sdb1" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized
[root@dlp ~]#
pvdisplay /dev/sdb1

  --- NEW Physical volume ---
  PV Name
/dev/sdb1

  VG Name
  PV Size
100.00 GB
# changed

  Allocatable
NO

  PE Size (KByte)
0

  Total PE
0

  Free PE
0

  Allocated PE
0

  PV UUID
hPjJK2-tEgt-RztW-CLLH-NYR3-4t4a-hNt6qT

[4] Output reports of Physical volumes
[root@dlp ~]#
pvs /dev/sdb1

  PV
VG
Fmt
Attr
PSize
PFree

  /dev/sdb1
lvm2
a-
100.00G
100.00G

[5] Scan Physical volumes
[root@dlp ~]#
pvscan /dev/sdb1

  PV
/dev/sda2
vg_dlp
lvm2 [29.51 GiB / 0 free]

  PV
/dev/sdb1
lvm2 [100.00 GiB]

  Total: 2 [44.51 GiB] / in use: 1 [29.51 GiB] / in no VG: 1 [100.00 GiB]
[6] Remove a Physical volume
[root@dlp ~]#
pvremove /dev/sdb1

  Labels on physical volume "/dev/sdb1" successfully wiped
[root@dlp ~]#
pvdisplay /dev/sdb1

  No physical volume label read from /dev/sdb1  
# none

  Failed to read physical volume "/dev/sdb1"
 
Tweet